package com.smartplatform.mapper;

import com.smartplatform.pojo.SysUserOnline;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * @Author 咕唧
 * @Date 2022/5/29 20:20
 * @Version 1.0
 */
public interface SysUserOnlineMapper {
    @Select("select sessionId from sys_user_online where login_name= #{loginName}")
    String findByUsername(String loginName);

    @Delete("delete from sys_user_online where login_name= #{loginName}")
    void deleteByUsername(String loginName);

    @Insert("insert into sys_user_online " +
            "values(#{sessionId},#{loginName},#{ipaddr},#{loginLocation}" +
            ",#{browser},#{os},#{status},#{startTimestamp},#{lastAccessTime},#{expireTime})")
    void insertOnline(SysUserOnline sysUserOnline);
}
